project(CHAKRA_PLATFORM_AGNOSTIC)

set(PL_SOURCE_FILES
  Common/UnicodeText.Common.cpp
  Linux/UnicodeText.ICU.cpp
  Linux/HiResTimer.cpp
  Linux/NumbersUtility.cpp
  Linux/Thread.cpp
  )

if(CMAKE_SYSTEM_NAME STREQUAL Linux)
set(PL_SOURCE_FILES ${PL_SOURCE_FILES}
  Linux/DateTime.cpp
  Linux/SystemInfo.cpp
  )
elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(PL_SOURCE_FILES ${PL_SOURCE_FILES}
  Unix/AssemblyCommon.cpp
  Unix/DateTime.cpp
  Unix/SystemInfo.cpp
  )
endif()

if(NOT STATIC_LIBRARY)
  # CH has a direct dependency to this project
  add_library (Chakra.Runtime.PlatformAgnostic.Singular STATIC
    ${PL_SOURCE_FILES}
    )
  target_include_directories (
    Chakra.Runtime.PlatformAgnostic.Singular PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
endif()

add_library (Chakra.Runtime.PlatformAgnostic OBJECT
  ${PL_SOURCE_FILES}
  )

target_include_directories (
  Chakra.Runtime.PlatformAgnostic PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
  )
